home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr11
/
pcv05n11.zip
/
TODAYS.BAS
< prev
next >
Wrap
BASIC Source File
|
1993-06-02
|
4KB
|
100 lines
DECLARE SUB TodaysFiles ()
COMMON SHARED CurDrv$, CurPath$, Today$, DestDrive$
Today$ = LEFT$(DATE$, 6) + RIGHT$(DATE$, 2) 'Today's date in DIR form
DestDrive$ = "A:" 'Current target drive. Change string to
'change the target drive
FOR NumOfDrives% = 1 TO 2 'To change # of drives to check, change number
READ CurDrv$ 'here and modify DATA statement at the end
SHELL "cd " + CurDrv$ + "\" 'Change directory of hard disk to root
SHELL "tree " + CurDrv$ + "\ > c:\alldirs.txt" 'Put output of TREE in a file
WorkFile$ = "c:\alldirs.txt" 'Establish variable for filename
OPEN WorkFile$ FOR INPUT AS #1 'Open the file for reading
LINE INPUT #1, TreeLine$ 'Strip off the first two lines of the
LINE INPUT #1, TreeLine$ 'file containing the TREE output
CLS : CurPath$ = CurDrv$: TodaysFiles 'Process root directory first
DO WHILE NOT EOF(1) 'Read until end-of-file reached
LINE INPUT #1, TreeLine$ 'Get next line of the file
Ptr% = 0 'Control variable for IF statements
FOR Indent% = 1 TO LEN(TreeLine$)
Temp% = ASC(MID$(TreeLine$, Indent%, 1))
IF Temp% > 32 AND Temp% < 127 THEN
Ptr% = Indent%: EXIT FOR
END IF
NEXT Indent%
IF Ptr% = 5 THEN 'Root-level directory
Root$ = MID$(TreeLine$, 5, LEN(TreeLine$))
CurPath$ = CurDrv$ + "\" + Root$
TodaysFiles
ELSEIF Ptr% = 9 THEN 'Level 2 directory
ThisDir$ = MID$(TreeLine$, 9, LEN(TreeLine$))
Level2$ = CurDrv$ + "\" + Root$ + "\" + ThisDir$
CurPath$ = Level2$: TodaysFiles
ELSEIF Ptr% = 13 THEN 'Level 3 directory
ThisDir$ = MID$(TreeLine$, 13, LEN(TreeLine$))
Level3$ = Level2$ + "\" + ThisDir$
CurPath$ = Level3$: TodaysFiles
ELSEIF Ptr% = 17 THEN 'Level 4 directory
ThisDir$ = MID$(TreeLine$, 17, LEN(TreeLine$))
Level4$ = Level3$ + "\" + ThisDir$
CurPath$ = Level4$: TodaysFiles
ELSEIF Ptr% = 21 THEN 'Level 5 directory
ThisDir$ = MID$(TreeLine$, 21, LEN(TreeLine$))
Level5$ = Level4$ + "\" + ThisDir$
CurPath$ = Level5$: TodaysFiles
END IF
LOOP
CLOSE #1
KILL WorkFile$
NEXT NumOfDrives%
DATA "C:", "F:"
CLS : SYSTEM
SUB TodaysFiles
DOSCmd$ = "dir " + CurPath$ + " /-P > c:\tempfile.xxx"
SHELL DOSCmd$
TempFile$ = "c:\tempfile.xxx"
OPEN TempFile$ FOR INPUT AS #2
DO WHILE NOT EOF(2)
LINE INPUT #2, DirEntry$
IF MID$(DirEntry$, 24, 8) = Today$ THEN
Ext$ = MID$(DirEntry$, 10, 3)
'*** The following line specifies which files to find ***
IF Ext$ = "ed" OR Ext$ = "ed1" OR Ext$ = "raw" THEN
Filename$ = RTRIM$(LEFT$(DirEntry$, 8))
CLS : LOCATE 13: PRINT CHR$(7)
PRINT "Press Y to copy ";
PRINT CurPath$ + "\" + Filename$ + "." + Ext$;
PRINT " or press N to go on"
DO: Reply$ = INKEY$
LOOP UNTIL UCASE$(Reply$) = "Y" OR UCASE$(Reply$) = "N"
IF UCASE$(Reply$) = "Y" THEN
IF LEN(CurPath$) > 2 THEN
SHELL "md " + DestDrive$ + MID$(CurPath$, 3)
Flag% = 1
END IF
CmdLine$ = "copy " + CurPath$ + "\" + Filename$
CmdLine$ = CmdLine$ + "." + Ext$ + " " + DestDrive$
IF Flag% = 1 THEN
CmdLine$ = CmdLine$ + MID$(CurPath$, 3): Flag% = 0
END IF
SHELL CmdLine$
END IF
END IF
END IF
LOOP
CLOSE #2
KILL TempFile$
END SUB